import 'package:flutter/material.dart';

import '../../config/theme/index.dart';
import '../../tools/theme_manager.dart';

/// 主题扩展
/// 用于在任何地方获取当前主题的颜色和图片资源
extension ThemeExtension on BuildContext {
  /// 是否是暗黑模式
  bool get isDarkMode => themeResources.isDarkMode;

  /// 获取当前主题图片
  ThemeImages get themeImages => themeResources.images;

  /// 主题色
  Color get primaryColor => themeColors.primaryColor;

  /// 导航栏背景颜色
  Color get appBarBackgroundColor => themeColors.appBarBackgroundColor;

  /// 导航栏图标颜色
  Color get appBarIconColor => themeColors.appBarIconColor;

  /// 导航栏标题颜色
  Color get appBarTitleColor => themeColors.appBarTitleColor;

  /// 光标颜色
  Color get cursorColor => themeColors.cursorColor;

  /// 背景颜色
  Color get scaffoldBackgroundColor => themeColors.scaffoldBackgroundColor;

  /// 一级字体颜色
  Color get titleColor1 => themeColors.titleColor1;

  /// 二级字体颜色
  Color get titleColor2 => themeColors.titleColor2;

  /// 三级字体颜色
  Color get titleColor3 => themeColors.titleColor3;

  /// 卡片背景颜色
  Color get cardBackgroundColor => themeColors.cardBackgroundColor;

  /// 分割线颜色
  Color get dividerColor => themeColors.dividerColor;
}
